<template>
  <div class="h5-wrapper">
    <div class="content">
      内容部分
      <!-- 路由出口 -->
      <router-view></router-view>
    </div>
    <nav class="tabbar">
      <!-- 用 router-link 替换 a 标签 -->
      <router-link to="/article">面经</router-link>
      <router-link to="/collect">收藏</router-link>
      <router-link to="/like">喜欢</router-link>
      <router-link to="/user">我的</router-link>
    </nav>
  </div>
</template>

<script>
export default {
  name: 'LayoutPage'
}
</script>

<style>
body{
  margin: 0;
  padding: 0;
}
</style>
<style lang="less" scoped>
.h5-wrapper {
  .content {
    margin-bottom: 51px;
  }
  .tabbar {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 50px;
    line-height: 50px;
    text-align: center;
    display: flex;
    background: #fff;
    border-top: 1px solid #e4e4e4;
    a {
      flex: 1;
      text-decoration: none;
      font-size: 14px;
      color: #333;
      -webkit-tap-highlight-color: transparent;


      // 高亮类名
    &.router-link-exact-active {
        color: #ffc302;
        // 颜色渐变
        animation: colorChange 0.2s linear infinite;
      }

      @keyframes colorChange {
        0% { color: #ffc302; }
        14% { color: #7dff4e; }
        28% { color: #fcff3b; }
        42% { color: #36e7ff; }
        56% { color: #3273ff; }
        70% { color: #d148ff; }
        84% { color: #ffa0c1; }
        100% { color: #ff202c; }
      }
    }
  }
}
</style>